#ifndef _HAL_MODBUS_MASTER_H
#define _HAL_MODBUS_MASTER_H
#include "main.h"
#include "hal_usart.h"
#define SLAVE_ADDR  01//从机地址


typedef struct{
	uint8_t Index;//索引
	uint32_t basic_addr;//基地址
	uint32_t addr_offset;//地址偏移
	uint16_t write_len;//读长度
}modData;

TypeLinkedList CTRLDataWrite06List;
TypeLinkedList CTRLDataWrite10List;
TypeLinkedList CTRLDataWrite30List;
modData mdData;




void MODH_Send03H(uint8_t _addr, 		uint16_t _reg, 	uint16_t 	_num);
void MODH_Send06H(uint8_t _addr, 		uint16_t _reg, 	uint16_t 	_value);
void MODH_Send10H(uint8_t _addr, 		uint16_t _reg, 	uint8_t 	_num, 	uint8_t *_buf);
void MODH_Send30H(uint8_t _addr, 		uint8_t _num, 	uint8_t *	_buf);
//读取
void MODH_Read_03H(uint8_t *tbuff, 	uint16_t tlen);
void MODH_Read_06H(uint8_t *tbuff, 	uint16_t tlen);
void MODH_Read_30H(uint8_t *tbuff, 	uint16_t tlen);
//上报到缓存
uint8_t MODH_WriteParam_06H(uint16_t _reg, uint16_t _value);
uint8_t MODH_WriteParam_10H(uint16_t _reg, uint8_t	_num, uint8_t *_buf,	uint16_t _len);










#endif



